#ifndef GLUI_H
#define GLUI_H

#include <GL/glut.h>
#include <GL/glui.h>

#include "GLUTFunctions.h"
#include "HMD.h"

// the user id's that we can use to identify which control
// caused the callback to be called
#define CB_DEPTH_BUFFER 0
#define CB_ACTION_BUTTON 1
#define CB_RESET 2
#define CB_FULL_SCREEN 3
#define CB_WIIMOTE 4

// pointers for all of the glui controls
extern GLUI *glui;
extern GLUI_Rollout		*scene_rollout;
extern GLUI_Rollout		*projection_rollout;
extern GLUI_Rollout		*wii_rollout;
extern GLUI_Rollout		*camera_rollout;

extern GLUI_Panel		*object_panel;
extern GLUI_Panel		*transform_panel;
extern GLUI_Panel		*camera_panel;
extern GLUI_Panel		*wiimote1_panel;
extern GLUI_Panel		*wiimote1_extra_panel;
extern GLUI_Panel		*wiimote2_panel;
extern GLUI_Panel		*wiimote2_extra_panel;
extern GLUI_Panel		*wii_tracker_panel;



extern GLUI_RadioGroup		*object_type_radio;
extern GLUI_RadioGroup		*projection_radio;
extern GLUI_RadioGroup		*pick_radio;

extern GLUI_Spinner		*eye_x_spin;
extern GLUI_Spinner		*eye_y_spin;
extern GLUI_Spinner		*eye_z_spin;
extern GLUI_Spinner		*lookat_x_spin;
extern GLUI_Spinner		*lookat_y_spin;
extern GLUI_Spinner		*lookat_z_spin;
extern GLUI_Spinner		*dist1_spin;
extern GLUI_Spinner		*dist2_spin;
extern GLUI_Spinner		*dist3_spin;

extern GLUI_Spinner		*nearplane_spin;
extern GLUI_Spinner		*focal_length_spin;
extern GLUI_Spinner		*farplane_spin;
extern GLUI_Spinner		*light_intensity_spin;
extern GLUI_Spinner		*IOD_spin;
extern GLUI_Spinner		*FOVY_spin;

extern GLUI_Translation	*nearplane_trans;
extern GLUI_Translation	*focal_length_trans;
extern GLUI_Translation	*farplane_trans;
extern GLUI_Translation	*light_intensity_trans;
extern GLUI_Translation	*IOD_trans;
extern GLUI_Translation	*FOVY_trans;

extern GLUI_Spinner		*LED1_x_spin;
extern GLUI_Spinner		*LED1_y_spin;
extern GLUI_Spinner		*LED2_x_spin;
extern GLUI_Spinner		*LED2_y_spin;
extern GLUI_Spinner		*LED3_x_spin;
extern GLUI_Spinner		*LED3_y_spin;
extern GLUI_Spinner		*Pitch;
extern GLUI_Spinner		*Roll;
extern GLUI_Spinner		*Eye_base_x;
extern GLUI_Spinner		*Eye_base_y;
extern GLUI_Spinner		*Eye_base_z;
extern GLUI_Spinner		*Lookat_base_x;
extern GLUI_Spinner		*Lookat_base_y;
extern GLUI_Spinner		*Lookat_base_z;


extern GLUI_Checkbox *draw_floor;
extern GLUI_Checkbox *draw_object;
extern GLUI_Checkbox *stereo_view;
extern GLUI_Checkbox *full_screen;
extern GLUI_Checkbox *use_depth_buffer;
extern GLUI_Checkbox *wiimote1_connected;
extern GLUI_Checkbox *wiimote2_connected;
extern GLUI_Checkbox *LED1_1;
extern GLUI_Checkbox *LED1_2;
extern GLUI_Checkbox *LED1_3;
extern GLUI_Checkbox *LED1_4;
extern GLUI_Checkbox *LED2_1;
extern GLUI_Checkbox *LED2_2;
extern GLUI_Checkbox *LED2_3;
extern GLUI_Checkbox *LED2_4;


// live variables
// each of these are associated with a control in the interface.
// when the control is modified, these variables are automatically updated
extern int live_object_type;	
extern int live_projection_type;
extern int live_pick_type;
extern float live_object_rotation[16];
extern float live_nearplane_trans;
extern float live_focal_length;
extern float live_farplane_trans;
extern float live_IOD_trans;
extern float live_FOVY_trans;
extern float live_light_intensity_trans;
extern float live_dist[3];

extern int live_draw_floor;
extern int live_draw_object;
extern int live_stereo_view;
extern int live_prevent_floor_culling;
extern int live_use_depth_buffer;

void GLUIInit(void);
void ToggleFullScreen();
void SetupSubwindow();


#endif